import { request } from "@/utils/service"
import { AddAdvertisingParams, AdvertisingList, DeleteAdvertisingParams, UpdateAdvertisingParams } from "./types"

export const getAdvertisingList = () => {
  return request<AdvertisingList>({
    url: "advertising/list/page",
    method: "post",
    data: JSON.stringify({})
  })
}

export const addAdvertising = (data: AddAdvertisingParams) => {
  return request<ApiResponseData<boolean>>({
    url: "advertising/add",
    method: "post",
    data
  })
}

export const updateAdvertising = (data: UpdateAdvertisingParams) => {
  return request<ApiResponseData<boolean>>({
    url: "advertising/update",
    method: "post",
    data
  })
}

export const deleteAdvertising = (data: DeleteAdvertisingParams) => {
  return request<ApiResponseData<boolean>>({
    url: "advertising/delete",
    method: "post",
    data
  })
}
